package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-04-17.
 * <br>
 * 添加首页广告的请求参数。
 */
public class AddHomeAdvertParam {
    /**
     * 广告标题
     */
    @NotBlank(message = "广告标题不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_500, message = "广告标题的长度在1至500个字之间")
    private String homeAdName;
    /**
     * 广告图片地址
     */
    @NotBlank(message = "广告图片地址不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_1000, message = "广告图片地址的长度在1至1000个字之间")
    private String homeAdUrl;
    /**
     * 广告跳转 URL
     */
    @NotBlank(message = "广告跳转URL不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_1000, message = "广告跳转URL的长度在1至1000个字之间")
    @Pattern(regexp = Constants.URL_FULL_RE, message = "广告跳转" + Constants.URL_FULL_RE_MSG)
    private String homeAdToUrl;
    /**
     * 广告是否显示
     */
    @NotBlank(message = "广告是否显示不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_1, message = "广告是否显示的长度为一个字符")
    @Pattern(regexp = Constants.NUMBER_EMPTY_RE, message = ("广告是否显示" + Constants.NUMBER_RE_MSG))
    private String isShow;

    /**
     * 默认构造器。
     */
    public AddHomeAdvertParam() {

    }

    public String getHomeAdName() {
        return homeAdName;
    }

    public void setHomeAdName(String homeAdName) {
        this.homeAdName = homeAdName;
    }

    public String getHomeAdUrl() {
        return homeAdUrl;
    }

    public void setHomeAdUrl(String homeAdUrl) {
        this.homeAdUrl = homeAdUrl;
    }

    public String getHomeAdToUrl() {
        return homeAdToUrl;
    }

    public void setHomeAdToUrl(String homeAdToUrl) {
        this.homeAdToUrl = homeAdToUrl;
    }

    public String getIsShow() {
        return isShow;
    }

    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("AddHomeAdvertParam{");
        sb.append("homeAdName='").append(homeAdName).append('\'');
        sb.append(", homeAdUrl='").append(homeAdUrl).append('\'');
        sb.append(", homeAdToUrl='").append(homeAdToUrl).append('\'');
        sb.append(", isShow='").append(isShow).append('\'');
        sb.append('}');
        return sb.toString();
    }
}